﻿using Microsoft.AspNetCore.Mvc;
using ST.Buz.Base.ViewModel;
using ST.Common.Util.Model;
using ST.Common.Util.Mvc;
using ST.Common.Util.Text;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ST.Buz.Web.Components
{
	public class ProdCatTreeViewComponent : ViewComponent
	{
		//public async Task<IViewComponentResult> InvokeAsync(string id, string catid, string orgid)
		//{
		//	var result = await GetItemsAsync(id, catid, orgid);
		//	return View();
		//}

		public IViewComponentResult Invoke(string callback, string id, int catid, int orgid)
		{
			ViewData["callback"] = TextHelper.GetString(callback);
			ViewData["id"] = TextHelper.GetString(id);
			ViewData["catid"] = catid;
			ViewData["orgid"] = orgid;
			return View();
		}

		//private Task<int> GetItemsAsync(string id, string catid, string orgid)
		//{
		//	return Task.FromResult(123);
		//}
	}
}
